package org.glxy.demo1;


import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
// 判断是否已经登录、解决乱码的问题
@Configuration
public class MyConfiguration {
    @Bean
//    只有有FilterRegistrationBean这样的一个对象,就会自动的装配到springboot的配置类中
    public FilterRegistrationBean<MyFilter> my(){
        FilterRegistrationBean<MyFilter> myFilterFilterRegistrationBean = new FilterRegistrationBean<>();
        myFilterFilterRegistrationBean.setFilter(new MyFilter());
        myFilterFilterRegistrationBean.addUrlPatterns("/aa");
        return myFilterFilterRegistrationBean;
    }
}
